<HTML>
<head>
	<title>Error</title>
	<meta HTTP-EQUIV="Cache-Control"  CONTENT="no-cache" />
	<meta HTTP-EQUIV="Expires"        CONTENT="1 Jan 1980" />
	<meta HTTP-EQUIV="MaxAge"         CONTENT="0" />
	<meta HTTP-EQUIV="Pragma-Control" CONTENT="no-cache" />
</head>
<BODY>
<%
	// Determine the root cause.
	Throwable exception = (Throwable)request.getAttribute("javax.servlet.jsp.jspException");
	Throwable rootException = exception;
	while(exception != null){
		rootException = exception;
  		exception = exception.getCause();
	}
	// get the root cause message
	String reason = rootException.getMessage();

	if(reason == null){
		reason = "Some error has occured";
	}else{
		// escape the " and ' characters , if any present as Javascript has a problem displaying such strings.
		reason = reason.replaceAll("\"","&quot;");
		reason = reason.replaceAll("\'","&#39;");

	}
	System.out.println("Error message to display " + reason);
%>

	<script>
		var reason = "<%=reason%>";

		parent.frameMain.disableEnable(false);
		parent.frameMain.displayError(reason);
	</script>
	<form action="merlin" name="frmSearch" method="post">
		<input type="hidden" name="mode">
		<input type="hidden" name="hidSearch">
		<input type="hidden" name="hidCompanies">
		<input type="hidden" name="hidSearchType">
	</form>
</BODY>
</HTML>